package com.shopnight.utils;


import cn.hutool.json.JSONObject;
import cn.hutool.json.JSONUtil;

public class WxSubscriptionUtil {



    public String getAccessToken() {
        String appId = "你的openId";
        String appSecret = "你的小程序密钥";
        String result = cn.hutool.http.HttpUtil.get("https://api.weixin.qq.com/cgi-bin/token?grant_type=client_credential&appid=" + appId + "&secret=" + appSecret);
        JSONObject jsonObject = JSONUtil.parseObj(result);
        return jsonObject.getStr("access_token");
    }


}
